package com.heqiang.tools;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("all")
public class Page<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private List<T> list = new ArrayList();
    private int total;
    private int pageNo;
    private int pageSize;
    private int totalPage;

    public static Boolean isEmpty(Page page) {
        return page != null && !CollectionUtils.isEmpty(page.getList()) ? false : true;
    }
}
